package logic

import (
	"activity_srv/internal/dao"
	"context"

	"activity_srv/activity"
	"activity_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UpdateGrouponProductLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUpdateGrouponProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateGrouponProductLogic {
	return &UpdateGrouponProductLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *UpdateGrouponProductLogic) UpdateGrouponProduct(in *activity.UpdateGrouponProductRequest) (*activity.UpdateGrouponProductResponse, error) {
	// todo: add your logic here and delete this line
	product, err := dao.UpdateGrouponProduct(in)
	if err != nil {
		return nil, err
	}
	return &activity.UpdateGrouponProductResponse{
		Id: int64(product.Id),
	}, nil
}
